package org.juggers.domain;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.util.Collection;

import com.google.inject.Singleton;

/**
 * @author <a href="mailto:michel@breizhjug.org">Michel DAVID</a>
 */
@Singleton
public class ModelState
    extends AbstractEntity
{
    
    private static final long serialVersionUID = -5609770169191726037L;

    private Jugger connectedJugger;
    
    private Event event;

    private Collection<Event> events;

    private Collection<UserGroup> userGroups;

    /**
     * @return the connectedJugger
     */
    public Jugger getConnectedJugger()
    {
        return connectedJugger;
    }

    /**
     * @param connectedJugger the connectedJugger to set
     */
    public void setConnectedJugger( Jugger connectedJugger )
    {
        Jugger oldValue = this.connectedJugger;
        this.connectedJugger = connectedJugger;
        firePropertyChange( "connectedJugger", oldValue, connectedJugger );
    }

    /**
     * @return the events
     */
    public Collection<Event> getEvents()
    {
        return events;
    }

    /**
     * @param events the events to set
     */
    public void setEvents( Collection<Event> events )
    {
        Collection<Event> oldValue = this.events;
        this.events = events;
        firePropertyChange( "events", oldValue, events );
    }
    
    /**
     * @return the event
     */
    public Event getEvent()
    {
        return event;
    }

    /**
     * @param event the event to set
     */
    public void setEvent( Event event )
    {
        Event oldValue = this.event;
        this.event = event;
        firePropertyChange( "event", oldValue, event );
    }

    /**
     * @return the userGroups
     */
    public Collection<UserGroup> getUserGroups()
    {
        return userGroups;
    }

    /**
     * @param userGroups the userGroups to set
     */
    public void setUserGroups( Collection<UserGroup> userGroups )
    {
        Collection<UserGroup> oldValue = this.userGroups;
        this.userGroups = userGroups;
        firePropertyChange( "userGroups", oldValue, userGroups );
    }
}
